import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import uvtw from '@uni-helper/vite-plugin-uni-tailwind'
import postcssConfig from './postcss.config'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    uni(),
    uvtw(),
  ],
  css: {
    postcss: postcssConfig,
  },
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  server: {
    port: 5174,
    proxy: {
      "/api/v1.0/portal": {
        target: "http://localhost:8081",
        changeOrigin: true,
      },
    },
  },
})
